import java.awt.Image;
import java.util.Random;

import javax.swing.ImageIcon;

public class Gold {
	private Image goldImage;
	private int mass;
	private int posX;
	private int posY;
	private Random rand;
	private int goldType;
	private int price;
	private boolean collected;

	public Gold(int x, int y, int m, int p) {
		setPosX(x);
		setPosY(y);
		mass = m;
		price = p;
		setCollected(false);
		
		rand = new Random();
		goldType = rand.nextInt(3) + 1;

		switch (mass) {
		case 1:
			setGoldImage((new ImageIcon(getClass().getResource(
					"image/objects/gold" + goldType + ".png"))).getImage());
			break;
		case 2:
			setGoldImage((new ImageIcon(getClass().getResource(
					"image/objects/mediumGold" + goldType + ".png")))
					.getImage());
			break;
		case 3:
			setGoldImage((new ImageIcon(getClass().getResource(
					"image/objects/smallGold" + goldType + ".png"))).getImage());
			break;
		}

	}

	public void setGoldImage(Image goldImage) {
		this.goldImage = goldImage;
	}

	public Image getGoldImage() {
		return goldImage;
	}

	public void setPosX(int posX) {
		this.posX = posX;
	}

	public int getPosX() {
		return posX;
	}

	public void setPosY(int posY) {
		this.posY = posY;
	}

	public int getPosY() {
		return posY;
	}

	public void setCollected(boolean collected) {
		this.collected = collected;
	}

	public boolean isCollected() {
		return collected;
	}
		
	
}
